OAuth.authorize

Authenticates the user with the application configured in the OAuth configurations on the Ebase server administration application. The scope parameter overrides the scope on the server administration application. The additionalParameters overrides any additional parameters configured on the administration application.

This method takes the user away from Ebase and to the application that requires authorization to allow Ebase access to the users account information. If the OAuthTokens already contains an access token or refresh token already then there is no need to authorize because the access has already been granted. Otherwise the user is prompted to login to the application to grant access and then is returned back to the Ebase application.

Javascript example:

 try {
   //RESTful service "MyApp" requires OAUTH authentication. 
   var params = {show_dialog : true};
   services.security.oauth.authorize("myApp", "private-read, private-write", params);
   //now perform a rest call
   var code = resources.MyApp.call();
 }
 catch (e) {
   event.owner.addErrorMessage(e.javaException.message);
 }
 

Parameters

java.lang.String  name,  java.lang.String  scope,  java.util.Map  additionalParameters,